<div id="mainColumns">
	<h2>クラス一覧を見る</h2>
	<?php if($message = $this->Session->flash('teachersuccess')):?>
	<p><?php echo $message;?></p>
	<?php elseif($message = $this->Session->flash('teachererror')): ?>
	<p><?php echo $message; ?></p>
	<?php endif; ?>
	<?php echo $this->Form->create(null, array('url' => array('controller' => 'user_transactions', 'action' => 'admin_index')));
		if(count($users) > 0):
		foreach ($users as $key => $u): ?>
		<div class="transactionUser">
			<h3><?php echo $this->User->getUsername($u);?> - <?php echo $u['Profile']['headline']; ?></h3>
			<?php 
				$enteredNumber = $u['EnteredCounting']['entered_number'] ? $u['EnteredCounting']['entered_number'] : 0 ;
				$attendNumber = $u['AttendCounting']['ettend_number'] ? $u['AttendCounting']['ettend_number'] : 0 ;
			?>
			<?php if(is_file(Configure::read('User.upload_dir_prefix').$u['Profile']['icon_image'])): ?>
			<?php echo $this->Html->image(Configure::read('User.upload_path_prefix').$u['Profile']['icon_image'], array('alt' => '', 'class' => 'user_icon'));?>
			<?php else: ?>
			<?php echo $this->Html->image(Configure::read('User.default_icon_image'), array('alt' => ''));?>
			<?php endif;?>
			<div class="halfBox">
				<p>参加したクラス数 <span class="num"><?php echo $enteredNumber; ?></span></p>
				<p>参加予定のクラス数 <span class="num"><?php echo $attendNumber; ?></span></p>
			</div>
			<p>
				<?php 
					if($u['Profile']['del_flg'] == 0){
						echo $this->Html->link('このユーザを削除する', array('controller' => 'members', 'action' => 'admin_delete', $u['Profile']['user_id'])) ;
					}
				?>
			</p>
			<p>
				<?php 
				if($u['Profile']['del_flg'] == 0){
					if($u['RecommendTeacher']['id'] == NULL){
						echo $this->Html->link('このユーザを人気講師に追加する', array('controller' => 'members', 'action' => 'admin_addRecommendTeacher', $u['Profile']['user_id'])) ;
					}else{
						echo $this->Html->link('このユーザを人気講師から外す', array('controller' => 'members', 'action' => 'admin_removeRecommendTeacher', $u['RecommendTeacher']['id'])) ;
					}
				}
				?>
			</p>
			<p class="right">
			<?php if($u['Profile']['del_flg'] == 0){
				echo $this->Html->link('このユーザの決済情報を見る.', array('controller' => 'user_transactions', 'action' => 'admin_view', $u['Profile']['user_id'])) ;
			}
			?>
			</p>
		</div>
		<?php endforeach;
		else:
			echo "<h2>No result</h2>";
		endif;
	echo $this->Form->end(); ?>
	<div id="pageNationBox">
		<?php echo $this->element('admin_paginator');?>
	</div>
	</div>
	<div id="subColumns">
	<?php echo $this->Form->create(null, array('controller' =>'user_transactions', 'action' => 'admin_index', 'id' => 'search_admin_index_form', 'type' => 'get')); ?>
		<div class="section">
			<div class="rows select">
				<p>検索結果数</p>
				<select name="limit" id="search_result_num">
					<option value="25" <?php if(isset($this->params['url']['limit']) && $this->params['url']['limit'] == 25){echo "selected ='true'" ;}?> >25</option>
					<option value="50" <?php if(isset($this->params['url']['limit']) && $this->params['url']['limit'] == 50){echo "selected ='true'" ;}?> >50</option>
					<option value="100" <?php if(isset($this->params['url']['limit']) && $this->params['url']['limit'] == 100){echo "selected ='true'" ;}?> >100</option>
				</select>
			</div>
			<div class="rows select">
				<p>検索対象</p>
				<select name="type" id="search_result_order">
					<option value="Users" selected="">ユーザ</option>
					<option value="Course">クラス</option>
				</select>
			</div>
			<div class="rows select">
				<p>ユーザ名</p>
				<input type="text" name="name" />
			</div>
		</div>
		<div class="section">
			<div class="rows" id="payment">
				<p>ユーザステータス</p>
				<input type="radio" name="status" id="" value="0" <?php if(!isset($this->params['url']['status']) || (isset($this->params['url']['status']) && $this->params['url']['status']== '0'))
					{echo "checked ='true'" ;}?> /> 削除を取り消す<br />
				<input type="radio" name="status" id="" value="1" <?php if(isset($this->params['url']['status']) && $this->params['url']['status'] == '1'){ echo "checked = 'true'" ;} ?> /> 削除<br />
			</div>
		</div>		
		<?php echo $this->Form->end('検索');?>
</div>